﻿using System;
using System.Collections.Generic;
using System.Text;
using Maticsoft.DBUtility;
using System.Data.SqlClient;
using System.Data;
using ExtendModule;
using LabMS.BLL;
using LabMS.Model;

namespace ExtendBLL
{
    public class ValuablesAnnualBenefitEvaluation : LabMS.BLL.ValuablesAnnualBenefitEvaluation
    {
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<ExtendModule.ValuablesAnnualBenefitEvaluation> GetExtendModelList(string strWhere)
        {
            DataSet ds = dal.GetInnerList(strWhere);
            List<ExtendModule.ValuablesAnnualBenefitEvaluation> modelList = new List<ExtendModule.ValuablesAnnualBenefitEvaluation>();
            int rowsCount = ds.Tables[0].Rows.Count;
            if (rowsCount > 0)
            {
                ExtendModule.ValuablesAnnualBenefitEvaluation model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ExtendModule.ValuablesAnnualBenefitEvaluation();

                    model.ID = long.Parse(ds.Tables[0].Rows[n]["ID"].ToString());
                    model.Numbers = ds.Tables[0].Rows[n]["Numbers"].ToString();
                    model.Name = ds.Tables[0].Rows[n]["Name"].ToString();
                    model.Years = ds.Tables[0].Rows[n]["Years"].ToString();
                    if (ds.Tables[0].Rows[n]["OperatDate"].ToString() != "")
                    {
                        model.OperatDate = DateTime.Parse(ds.Tables[0].Rows[n]["OperatDate"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["PurchaseDate"].ToString() != "")
                    {
                        model.PurchaseDate = DateTime.Parse(ds.Tables[0].Rows[0]["PurchaseDate"].ToString());
                    }
                    model.Score = ds.Tables[0].Rows[n]["Score"].ToString();
                    model.Operator = ds.Tables[0].Rows[n]["Operator"].ToString();
                    model.Standards = ds.Tables[0].Rows[n]["Standards"].ToString();
                    model.UnitPrice = ds.Tables[0].Rows[n]["UnitPrice"].ToString();
                    model.ResponesoblePerson = ds.Tables[0].Rows[n]["ResponesoblePerson"].ToString();
                    
                    modelList.Add(model);
                }
            }

            return modelList;
        }

    }
}
